package com.control.qct.businesssteward.adapter;

import android.support.annotation.Nullable;

import com.control.qct.businesssteward.R;
import com.control.qct.businesssteward.model.EverydayAccountModel;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.control.qct.businesssteward.utils.DecimalFormatUtils;

import java.util.List;

/**
 * 日结月结汇总适配器
 * Created by Administrator on 2017/12/12 0012.
 */

public class EverydayAccountAdapter extends BaseQuickAdapter<EverydayAccountModel.SummaryBean
        .StoreSaleOrderDetailsBean, BaseViewHolder> {

    public EverydayAccountAdapter(@Nullable List<EverydayAccountModel.SummaryBean.StoreSaleOrderDetailsBean> data) {
        super(R.layout.rv_everyday_account_item, data);
    }

    @Override
    protected void convert(BaseViewHolder holder, EverydayAccountModel.SummaryBean.StoreSaleOrderDetailsBean item) {
        holder.setText(R.id.tv_shop_name, item.getStoreTitle()).setText(R.id.tv_saleroom_total, DecimalFormatUtils
                .DecimalFormatTwo(item.getXsMoney())).setText(R.id.tv_exchange_income, DecimalFormatUtils
                .DecimalFormatTwo(item.getRkMoney())).setText(R.id.tv_return_goods_outcome, DecimalFormatUtils
                .DecimalFormatTwo(item.getCkMoney())).setText(R.id.tv_return_order_total, item.getTuiCount() + "");

        holder.addOnClickListener(R.id.tv_detail);
    }
}
